# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=sequoia-sqv
pkgver=1.1.0
pkgrel=1
pkgdesc='Simple OpenPGP signature verification program'
url='https://sequoia-pgp.org/'
arch=('loong64' 'x86_64')
license=('GPL2')
groups=('sequoia')
depends=('glibc' 'nettle' 'libnettle.so' 'libhogweed.so'
         'gcc-libs' 'gmp')
makedepends=('git' 'cargo' 'clang')
source=("git+https://gitlab.com/sequoia-pgp/sequoia-sqv.git#tag=v${pkgver}?signed")
sha512sums=('SKIP')
validpgpkeys=(
  D2F2C5D45BE9FDE6A4EE0AAF31855247603831FD # justus@sequoia-pgp.org
  CBCD8F030588653EEDD7E2659B7DD433F254904A # justus@sequoia-pgp.org
  D2F2C5D45BE9FDE6A4EE0AAF31855247603831FD # justus@sequoia-pgp.org
)

build() {
  cd sequoia-sqv
  export CARGO_TARGET_DIR=target
  cargo build --release --locked --features 'crypto-nettle'
}

check() {
  cd sequoia-sqv
  cargo test --release --locked --features 'crypto-nettle'
}

package() {
  cd sequoia-sqv
  install -Dm 755 target/release/sqv -t "${pkgdir}/usr/bin"

	install -Dm 644 target/sqv.bash "${pkgdir}/usr/share/bash-completion/completions/sqv"
	install -Dm 644 target/_sqv -t "${pkgdir}/usr/share/zsh/site-functions"
	install -Dm 644 target/sqv.fish -t "${pkgdir}/usr/share/fish/vendor_completions.d"

  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
